/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package parser;

import java.awt.Color;
import java.util.ArrayList;

/**
 *
 * @author nate
 */
public class CompositePhrase implements Phrase, PhraseDecorator
{
    private static CompositePhrase instance = null;
    private ArrayList<Phrase> phrases = new ArrayList<Phrase>();


   private CompositePhrase()
   {
      // Exists only to defeat instantiation.
   }

    public void Print()
    {
        for(int i = 0; i < phrases.size(); i++)
        {
            phrases.get(i).Print();
        }
    }

    public void Save(Phrase newPhrase)
    {
        phrases.add(newPhrase);
    }

   public static CompositePhrase getInstance()
   {
      if(instance == null)
      {
         instance = new CompositePhrase();
      }
      return instance;
   }

   //--This needs to be added to JavaCC maybe???
   public ArrayList<Phrase> getPhrases()
   {
       return phrases;
   }
   
    public String getValue()
    {
        return null;
    }

    public Color getColor() 
    {
    return null;
    }
       public String getAssociations()
    {
        return null;
    }
    public String getType()
    {
        return "composite";
    }
}


